<?php
$page = 'GT5';
$in_site = 'dassnfu';
$loginVereist = 2;
include($_SERVER['DOCUMENT_ROOT']."/start.php");
//setlocale (LC_ALL, "Dutch");

function getBandenNaam($banden) {
	switch($banden) {
		case 1:		return "comfort: hard";
		case 2:		return "comfort: normaal";
		case 3:		return "comfort: zacht";
		case 4:		return "sport: hard";
		case 5:		return "sport: normaal";
		case 6:		return "sport: zacht";
		case 7:		return "race: hard";
		case 8:		return "race: normaal";
		case 9:		return "race: zacht";
		default:	return "-";
	}
}
function getBandenSelect($selectie, $naam) {
	$result = "<select name='".$naam."'>";
		$result .= "<option value='0'".($selectie == 0 ? " selected='selected'" : "").">-</option>";
		$result .= "<option value='1'".($selectie == 1 ? " selected='selected'" : "").">comport: hard</option>";
		$result .= "<option value='2'".($selectie == 2 ? " selected='selected'" : "").">comport: normaal</option>";
		$result .= "<option value='3'".($selectie == 3 ? " selected='selected'" : "").">comport: zacht</option>";
		$result .= "<option value='4'".($selectie == 4 ? " selected='selected'" : "").">sport: hard</option>";
		$result .= "<option value='5'".($selectie == 5 ? " selected='selected'" : "").">sport: normaal</option>";
		$result .= "<option value='6'".($selectie == 6 ? " selected='selected'" : "").">sport: zacht</option>";
		$result .= "<option value='7'".($selectie == 7 ? " selected='selected'" : "").">race: hard</option>";
		$result .= "<option value='8'".($selectie == 8 ? " selected='selected'" : "").">race: normaal</option>";
		$result .= "<option value='9'".($selectie == 9 ? " selected='selected'" : "").">race: zacht</option>";
	$result .= "</select>";
	return $result;
}

$bestanden = "<link rel='stylesheet' type='text/css' href='/bestanden/css/post/post.css' />
<link rel='stylesheet' type='text/css' href='/bestanden/css/style_tabellen.css' />
<!-- JQuery ui -->
<link rel='stylesheet' type='text/css' href='/bestanden/js/jqueryui/css/jquery-ui-1.9.2.custom.min.css' />
<script type='text/javascript' src='/bestanden/js/jqueryui/js/jquery-ui-1.9.2.custom.min.js'></script>
<!-- Q-tip -->
<link rel='stylesheet' type='text/css' href='/bestanden/js/qtip/css/jquery.qtip".$style_nmr.".css' />
<script type='text/javascript' src='/bestanden/js/qtip/js/jquery.qtip.min.js'></script>
<script type='text/javascript' src='/bestanden/js/qtip/js/standard_initialize.js'></script>
<script type='text/javascript'>
	$(document).ready(function() {
	//	$('.jslider').slider('test', 1, 10);
		$('.sortable').sortable({placeholder: 'ui-state-highlight'});
		
		// waarde toevoegen
		$('.add').click(function() {
			var addTo = $(this).prev();
			var name = $(this).attr('alt');
			var makeElement = '<li>&bull; <input class=\"small_input\" type=\"text\" name=\"v' + name + '[]\"></li>';
			console.log(addTo);
			addTo.append(makeElement);
		});
	})
</script>
<style>
a {
	color: #666;
}
a:hover {
	color: #666;
}
ul.sortable {
	list-style-type: none;
	padding: 0px;
	margin: 0px;
	cursor: pointer;
}
.ui-state-highlight { height: 1.5em; line-height: 1.2em;}
input{
	width: 35px;
	text-align: right;
}
input.small_input {
	width: 28px;
}
.add {
	cursor: pointer;
}
.right_align {
	text-align: right;
}
</style>";

include_once($_SERVER['DOCUMENT_ROOT']."/php_functions/database_connectie.php");
if(isset($_POST['submit']) && isset($_GET['setup']) && isset($_GET['wijzig'])) {
	// MOET ER TOEGEVOEGD WORDEN AAN DE SETUP TABEL OF AAN DE SETUPGEGEVENS TABLEL
	if(($_GET['wijzig'] > 6 && $_GET['wijzig'] < 19) || $_GET['wijzig'] == 20 || $_GET['wijzig'] > 21 ) {
		// voeg de gegevens toe aan SETUPGEGEVENS
		//OM WELKE POST GAAT HET?
		for($i = 1; $i <= 33; $i++) {
			if(isset($_POST['v'.$i])) {
				$goedheid = 0;
				foreach($_POST['v'.$i] as $post) {
					//Is de setup toespoor/uitspoor, Camber(-) of Veerkracht (kgf/mm), vermenigvuldig de ingevulde waarde dan met 100, 10 of 10
					if($_GET['wijzig'] == 13) {									$post = $post * 100;}
					else if($_GET['wijzig'] == 8 || $_GET['wijzig'] == 14) {	$post = $post * 10;}
					
					// STAAT HET VELD MET DE DESBETREFFENDE WAARDE AL IN DE DATABASE?
					$result = mysql_query("SELECT * FROM setupgegevens WHERE setupId = '".$_GET['setup']."' AND veld = '".$i."' AND waarde = '".$post."'");
					//echo "SELECT * FROM setupgegevens WHERE setupId = '".$_GET['setup']."' AND veld = '".$i."' AND waarde = '".$post."'";
					// JA DEZE WAARDE BESTAAT AL
					if($result <> null && mysql_num_rows($result) > 0) {
						//wijzig
						mysql_query("UPDATE setupgegevens SET goedheid = '".$goedheid."' WHERE setupId = '".$_GET['setup']."' AND veld = '".$i."' AND waarde = '".$post."'");
						//echo "UPDATE setupgegevens SET goedheid = '".$goedheid."' WHERE setupId = '".$_GET['setup']."' AND veld = '".$i."' AND waarde = '".$post."'<br>";
					}else {
						//voeg toe
						mysql_query("INSERT INTO setupgegevens VALUES('".$_GET['setup']."', '".$i."', '".$post."', '".$goedheid."')");
						//echo "INSERT INTO setupgegevens VALUES('".$_GET['setup']."', '".$i."', '".$post."', '".$goedheid."')<br>";
					}
					$goedheid++;
				}
			}
		}
	}else if($_GET['wijzig'] <= 6 || $_GET['wijzig'] == 19 || $_GET['wijzig'] == 21) {
		// Voeg de gegevens toe aan de setup (eerst controleren of de waardes goed zijn ingevuld)
		if($_GET['wijzig'] == 1 && isset($_POST['prestatiepunten'])) {
			// Update de prestatiepunten
			$result = mysql_query("UPDATE setup SET prestatiepunten = '".$_POST['prestatiepunten']."' WHERE setupId = '".$_GET['setup']."'");
		}else if($_GET['wijzig'] == 2 && isset($_POST['gewichtVoor']) && isset($_POST['gewichtAchter'])) {
			// Update de gewichtsverdeling
			$result = mysql_query("UPDATE setup SET gewichtVoor = '".$_POST['gewichtVoor']."', gewichtAchter = '".$_POST['gewichtAchter']."' WHERE setupId = '".$_GET['setup']."'");
		}else if($_GET['wijzig'] == 3 && isset($_POST['vermogen'])) {
			// Update de vermogen
			$result = mysql_query("UPDATE setup SET vermogen = '".$_POST['vermogen']."' WHERE setupId = '".$_GET['setup']."'");
		}else if($_GET['wijzig'] == 4 && isset($_POST['bandenVoor'])) {
			// Update de banden voor
			$result = mysql_query("UPDATE setup SET bandenVoor = '".$_POST['bandenVoor']."' WHERE setupId = '".$_GET['setup']."'");
		}else if($_GET['wijzig'] == 5 && isset($_POST['gewicht'])) {
			// Update de gewicht
			$result = mysql_query("UPDATE setup SET gewicht = '".$_POST['gewicht']."' WHERE setupId = '".$_GET['setup']."'");
		}else if($_GET['wijzig'] == 6 && isset($_POST['bandenAchter'])) {
			// Update de banden achter
			$result = mysql_query("UPDATE setup SET bandenAchter = '".$_POST['bandenAchter']."' WHERE setupId = '".$_GET['setup']."'");
		}else if($_GET['wijzig'] == 13 && isset($_POST['ballast'])) {
			// Update de ballast
			$result = mysql_query("UPDATE setup SET ballast = '".$_POST['ballast']."' WHERE setupId = '".$_GET['setup']."'");
		}else if($_GET['wijzig'] == 13 && isset($_POST['vermogensniveau'])) {
			// Update vermogensniveau
			$result = mysql_query("UPDATE setup SET vermogensniveau = '".($_POST['vermogensniveau']*10)."' WHERE setupId = '".$_GET['setup']."'");
		}else {
			echo "<p>De ingevulde gegevens zijn niet verzonden</p>";
		}
	}else {
		// Voeg de gegevens toe aan de setup, maar dan de eerste 6 
	}
}

include_once($_SERVER['DOCUMENT_ROOT']."/header.php");
include_once($_SERVER['DOCUMENT_ROOT']."/sidebar.php");

echo $mainClass->showPageStart();

if(empty($_GET['setup'])) {
	$mainClass->allesGoed = true;
	// Selecteer de auto
	$result = mysql_query("SELECT DISTINCT auto.autoId, auto.* FROM setup, auto WHERE auto.autoId = setup.autoId ORDER BY naam");
	if($result <> null && mysql_num_rows($result) > 0) {
		echo "<p>Auto</p>";
		echo "<select name='auto' onchange='location = this.options[this.selectedIndex].value;'>";
		echo "<option value='./'>Selecteer een auto</option>";
		while($row = mysql_fetch_array($result)) {
			echo "<option value='./?auto=".$row['autoId']."'".(isset($_GET['auto']) && $_GET['auto'] == $row['autoId'] ? " selected='yes'" : "").">".$row['naam']."</option>";
		}
		echo "</select>";
	}else {
		echo "<p>Geen setups beschikbaar.</p>";
		$mainClass->allesGoed = false;
	}
	
	// Laat de setups zien
	if($mainClass->allesGoed) {
		$result = mysql_query("SELECT auto.naam AS autonaam, circuit.naam AS circuitnaam, setup.setupId, setup.prestatiepunten FROM auto, setup LEFT JOIN circuit ON circuit.circuitId = setup.circuitId WHERE setup.autoId = '".$_GET['auto']."' AND auto.autoId = setup.autoId");
		//echo "SELECT auto.*, circuit.*, setup.setupId, setup.prestatiepunten FROM auto, setup LEFT JOIN circuit ON circtuit.circuitId = setup.circuitId WHERE setup.autoId = '".$_GET['auto']."' AND auto.autoId = setup.autoId";
		if($result <> null && mysql_num_rows($result) > 0) {
			echo "<br><br>";
			echo "<table class='content padding'>";
			while($row = mysql_fetch_array($result)) {
				echo "<tr class='klein'>";
					echo "<td><a class='icon_font' href='./?setup=".$row['setupId']."'>&#x41;</a></td>";
					echo "<td>".$row['autonaam']."</td>";
					echo "<td>".$row['circuitnaam']."</td>";
					echo "<td>".$row['prestatiepunten']."</td>";
				echo "</tr>";
			}
			echo "</table>";
		}
	}
}else {
	//Haal het event op
	/*
	$result = mysql_query("SELECT * FROM event WHERE eventId = '".$_GET['event']."'");
	if($result <> null && mysql_num_rows($result) > 0) {
		while($row = mysql_fetch_array($result)) {
		}
	}
	*/
	// TERUG
	
	$result = mysql_query("SELECT * FROM setup, auto WHERE setupId = '".$_GET['setup']."' AND auto.autoId = setup.autoId");
	if($result <> null && mysql_num_rows($result) > 0) {
		$row = mysql_fetch_array($result);
		
		// TERUG KNOP
		echo "<span class='button' style='margin: 10px 5px 0px;'><a href='./?auto=".$row['autoId']."'><span class='icon_font'>B</span> Terug</a></span>";
		echo "<br><br>";
		echo "<h3>".$row['naam']."</h3>";
	
		echo "<br>";
	
		$wijzig = 1;
		if(isset($_GET['wijzig'])) {
			echo "<form action='./?setup=".$_GET['setup']."&wijzig=".$_GET['wijzig']."' method='post'>";
		}
		echo "<table class='list left_align padding' style='margin-left: 30px;'>";
			echo "<tr>";
				// Prestatiepunten
				if(empty($_GET['wijzig']) || $_GET['wijzig'] <> $wijzig) {
					echo "<td style='width: 130px;' class='bold'><a href='./?setup=".$_GET['setup']."&wijzig=".$wijzig."'>Prestatiepunten</a></td>";
					echo "<td style='width: 180px;' class='bold'>".number_format($row['prestatiepunten'], 0, ',', '.')."</td>";
				}else {
					echo "<td style='width: 130px;' class='bold'><a href='./?setup=".$_GET['setup']."'>Prestatiepunten</a></td>";
					echo "<td style='width: 180px;' class='bold'><input type='text' name='prestatiepunten' value='".$row['prestatiepunten']."'></input></td>";
				}
				$wijzig++;
				// Gewichtsverdeling
				if(empty($_GET['wijzig']) || $_GET['wijzig'] <> $wijzig) {
					echo "<td style='width: 130px;'><a href='./?setup=".$_GET['setup']."&wijzig=".$wijzig."'>Gewichtsverdeling</a></td>";
					echo "<td style='width: 180px;'>".$row['gewichtVoor']."/".$row['gewichtAchter']."</td>";
				}else {
					echo "<td style='width: 130px;'><a href='./?setup=".$_GET['setup']."'>Gewichtsverdeling</a></td>";
					echo "<td style='width: 180px;'><input class='small_input' type='text' name='gewichtVoor' value='".$row['gewichtVoor']."'></input> / <input class='small_input' type='text' name='gewichtAchter' value='".$row['gewichtAchter']."'></input></td>";
				}
				$wijzig++;
			echo "</tr>";
			echo "<tr>";
				// Maximaal vermogen
				if(empty($_GET['wijzig']) || $_GET['wijzig'] <> $wijzig) {
					echo "<td style='width: 130px;'><a href='./?setup=".$_GET['setup']."&wijzig=".$wijzig."'>Maximaal vermogen</a></td>";
					echo "<td style='width: 180px;'>".number_format($row['vermogen'], 0, ',', '.')."</td>";
				}else {
					echo "<td style='width: 130px;'><a href='./?setup=".$_GET['setup']."'>Maximaal vermogen</a></td>";
					echo "<td style='width: 180px;'><input type='text' name='vermogen' value='".$row['vermogen']."'></input></td>";
				}
				$wijzig++;
				
				// Banden voor
				if(empty($_GET['wijzig']) || $_GET['wijzig'] <> $wijzig) {
					echo "<td style='width: 130px;'><a href='./?setup=".$_GET['setup']."&wijzig=".$wijzig."'>Banden voor</a></td>";
					echo "<td style='width: 180px;'>".getBandenNaam($row['bandenVoor'])."</td>";
				}else {
					echo "<td style='width: 130px;'><a href='./?setup=".$_GET['setup']."'>Banden voor</a></td>";
					echo "<td style='width: 180px;'>".getBandenSelect($row['bandenVoor'], 'bandenVoor')."</td>";
				}
				$wijzig++;
			echo "</tr>";
			echo "<tr>";
				// Gewicht
				if(empty($_GET['wijzig']) || $_GET['wijzig'] <> $wijzig) {
					echo "<td style='width: 130px;'><a href='./?setup=".$_GET['setup']."&wijzig=".$wijzig."'>Gewicht</a></td>";
					echo "<td style='width: 180px;'>".number_format($row['gewicht'], 0, ',', '.')."kg</td>";
				}else {
					echo "<td style='width: 130px;'><a href='./?setup=".$_GET['setup']."'>Gewicht</a></td>";
					echo "<td style='width: 180px;'><input type='text' name='gewicht' value='".$row['gewicht']."'></input></td>";
				}
				$wijzig++;
				
				// Banden achter
				if(empty($_GET['wijzig']) || $_GET['wijzig'] <> $wijzig) {
					echo "<td style='width: 130px;'><a href='./?setup=".$_GET['setup']."&wijzig=".$wijzig."'>Banden achter</a></td>";
					echo "<td style='width: 180px;'>".getBandenNaam($row['bandenAchter'])."</td>";
				}else {
					echo "<td style='width: 130px;'><a href='./?setup=".$_GET['setup']."'>Banden achter</a></td>";
					echo "<td style='width: 180px;'>".getBandenSelect($row['bandenAchter'], 'bandenAchter')."</td>";
				}
				$wijzig++;
			echo "</tr>";
		echo "</table>";
		
		
		// HAAL DE INSTELLINGEN OP
		$result = mysql_query("SELECT * FROM setupgegevens WHERE setupId = '".$_GET['setup']."' ORDER BY veld, goedheid, waarde");
		$row2 = mysql_fetch_array($result);
		$i = 1;
		
		echo "<div class='left' style='float: left; width: 350px;'>";
			echo "<table class='content small_border right_align padding'>";
				// ophanging
				echo "<tr class='klein'>";
					echo "<td style='width: 170px;' class='sub_titel no_hover left_align'>Ophanging</td>";
					echo "<td style='width: 40px;' class='sub_titel no_hover'>Voor</td>";
					echo "<td style='width: 40px;' class='sub_titel no_hover'>Achter</td>";
				echo "</tr>";
				
				//Aanpassing rijhoogte
				if(empty($_GET['wijzig']) || $_GET['wijzig'] <> $wijzig) {
					echo "<tr class='klein'>";
						echo "<td class='left_align'><a href='./?setup=".$_GET['setup']."&wijzig=".$wijzig."'>Aanpassing rijhoogte (mm)</a></td>";
						if($row2['veld'] == $i) {$waarde = $row2['waarde'];$row2 = mysql_fetch_array($result);echo "<td";if($row2['veld'] == $i) {echo " class='tooltip_disappear' title='".$row2['waarde'];while($row2 = mysql_fetch_array($result)) {if($row2['veld'] == $i){echo "<br>".$row2['waarde'];}else {break;}}echo "'";}echo ">".$waarde."</td>";}else {echo "<td>-</td>";}$i++;
						if($row2['veld'] == $i) {$waarde = $row2['waarde'];$row2 = mysql_fetch_array($result);echo "<td";if($row2['veld'] == $i) {echo " class='tooltip_disappear' title='".$row2['waarde'];while($row2 = mysql_fetch_array($result)) {if($row2['veld'] == $i){echo "<br>".$row2['waarde'];}else {break;}}echo "'";}echo ">".$waarde."</td>";}else {echo "<td>-</td>";}$i++;
					echo "</tr>";
				}else {
					//Wijzigen
					echo "<tr class='klein'>";
						echo "<td class='left_align'><a href='./?setup=".$_GET['setup']."'>Aanpassing rijhoogte (mm)</a></td>";
						if($row2['veld'] == $i) {echo "<td style='overflow: visible;'><ul class='sortable'><li>&bull; <input class='small_input' type='text' name='v".$i."[]' value='".$row2['waarde']."' readonly='readonly'></li>";while($row2 = mysql_fetch_array($result)) {if($row2['veld'] == $i) {echo "<li>&bull; <input class='small_input' type='text' name='v".$i."[]' value='".$row2['waarde']."' readonly='readonly'></li>";}else {break;}}echo "</ul><span class='add' alt='".$i."'>+</span></td>";}else {echo "<td><ul class='sortable'></ul><span class='add' alt='".$i."'>+</span></td>";}$i++;
						if($row2['veld'] == $i) {echo "<td style='overflow: visible;'><ul class='sortable'><li>&bull; <input class='small_input' type='text' name='v".$i."[]' value='".$row2['waarde']."' readonly='readonly'></li>";while($row2 = mysql_fetch_array($result)) {if($row2['veld'] == $i) {echo "<li>&bull; <input class='small_input' type='text' name='v".$i."[]' value='".$row2['waarde']."' readonly='readonly'></li>";}else {break;}}echo "</ul><span class='add' alt='".$i."'>+</span></td>";}else {echo "<td><ul class='sortable'></ul><span class='add' alt='".$i."'>+</span></td>";}$i++;
					echo "</tr>";
				}
				$wijzig++;
				// Veerkracht
				if(empty($_GET['wijzig']) || $_GET['wijzig'] <> $wijzig) {
					echo "<tr class='klein'>";
						echo "<td class='left_align'><a href='./?setup=".$_GET['setup']."&wijzig=".$wijzig."'>Veerkracht (kgf/mm)</a></td>";
						if($row2['veld'] == $i) {$waarde = (empty($row2['waarde']) ? "0" : number_format(($row2['waarde']/10), 1, ',', '.'));$row2 = mysql_fetch_array($result);echo "<td";if($row2['veld'] == $i) {echo " class='tooltip_disappear' title='".(empty($row2['waarde']) ? "0" : number_format(($row2['waarde']/10), 1, ',', '.'));while($row2 = mysql_fetch_array($result)) {if($row2['veld'] == $i){echo "<br>".(empty($row2['waarde']) ? "0" : number_format(($row2['waarde']/10), 1, ',', '.'));}else {break;}}echo "'";}echo ">".$waarde."</td>";}else {echo "<td>-</td>";}$i++;
						if($row2['veld'] == $i) {$waarde = (empty($row2['waarde']) ? "0" : number_format(($row2['waarde']/10), 1, ',', '.'));$row2 = mysql_fetch_array($result);echo "<td";if($row2['veld'] == $i) {echo " class='tooltip_disappear' title='".(empty($row2['waarde']) ? "0" : number_format(($row2['waarde']/10), 1, ',', '.'));while($row2 = mysql_fetch_array($result)) {if($row2['veld'] == $i){echo "<br>".(empty($row2['waarde']) ? "0" : number_format(($row2['waarde']/10), 1, ',', '.'));}else {break;}}echo "'";}echo ">".$waarde."</td>";}else {echo "<td>-</td>";}$i++;
					echo "</tr>";
				}else {
					//Wijzigen
					echo "<tr class='klein'>";
						echo "<td class='left_align'><a href='./?setup=".$_GET['setup']."'>Veerkracht (kgf/mm)</a></td>";
						if($row2['veld'] == $i) {echo "<td style='overflow: visible;'><ul class='sortable'><li>&bull; <input class='small_input' type='text' name='v".$i."[]' value='".($row2['waarde']/10)."' readonly='readonly'></li>";while($row2 = mysql_fetch_array($result)) {if($row2['veld'] == $i) {echo "<li>&bull; <input class='small_input' type='text' name='v".$i."[]' value='".($row2['waarde']/10)."' readonly='readonly'></li>";}else {break;}}echo "</ul><span class='add' alt='".$i."'>+</span></td>";}else {echo "<td><ul class='sortable'></ul><span class='add' alt='".$i."'>+</span></td>";}$i++;
						if($row2['veld'] == $i) {echo "<td style='overflow: visible;'><ul class='sortable'><li>&bull; <input class='small_input' type='text' name='v".$i."[]' value='".($row2['waarde']/10)."' readonly='readonly'></li>";while($row2 = mysql_fetch_array($result)) {if($row2['veld'] == $i) {echo "<li>&bull; <input class='small_input' type='text' name='v".$i."[]' value='".($row2['waarde']/10)."' readonly='readonly'></li>";}else {break;}}echo "</ul><span class='add' alt='".$i."'>+</span></td>";}else {echo "<td><ul class='sortable'></ul><span class='add' alt='".$i."'>+</span></td>";}$i++;
					echo "</tr>";
				}
				$wijzig++;
				
				// Dempers (uit)				
				if(empty($_GET['wijzig']) || $_GET['wijzig'] <> $wijzig) {
					echo "<tr class='klein'>";
						echo "<td class='left_align'><a href='./?setup=".$_GET['setup']."&wijzig=".$wijzig."'>Dempers (uit)</a></td>";
						if($row2['veld'] == $i) {$waarde = $row2['waarde'];$row2 = mysql_fetch_array($result);echo "<td";if($row2['veld'] == $i) {echo " class='tooltip_disappear' title='".$row2['waarde'];while($row2 = mysql_fetch_array($result)) {if($row2['veld'] == $i){echo "<br>".$row2['waarde'];}else {break;}}echo "'";}echo ">".$waarde."</td>";}else {echo "<td>-</td>";}$i++;
						if($row2['veld'] == $i) {$waarde = $row2['waarde'];$row2 = mysql_fetch_array($result);echo "<td";if($row2['veld'] == $i) {echo " class='tooltip_disappear' title='".$row2['waarde'];while($row2 = mysql_fetch_array($result)) {if($row2['veld'] == $i){echo "<br>".$row2['waarde'];}else {break;}}echo "'";}echo ">".$waarde."</td>";}else {echo "<td>-</td>";}$i++;
					echo "</tr>";
				}else {
					//Wijzigen
					echo "<tr class='klein'>";
						echo "<td class='left_align'><a href='./?setup=".$_GET['setup']."'>Dempers (uit)</a></td>";
						if($row2['veld'] == $i) {echo "<td style='overflow: visible;'><ul class='sortable'><li>&bull; <input class='small_input' type='text' name='v".$i."[]' value='".$row2['waarde']."' readonly='readonly'></li>";while($row2 = mysql_fetch_array($result)) {if($row2['veld'] == $i) {echo "<li>&bull; <input class='small_input' type='text' name='v".$i."[]' value='".$row2['waarde']."' readonly='readonly'></li>";}else {break;}}echo "</ul><span class='add' alt='".$i."'>+</span></td>";}else {echo "<td><ul class='sortable'></ul><span class='add' alt='".$i."'>+</span></td>";}$i++;
						if($row2['veld'] == $i) {echo "<td style='overflow: visible;'><ul class='sortable'><li>&bull; <input class='small_input' type='text' name='v".$i."[]' value='".$row2['waarde']."' readonly='readonly'></li>";while($row2 = mysql_fetch_array($result)) {if($row2['veld'] == $i) {echo "<li>&bull; <input class='small_input' type='text' name='v".$i."[]' value='".$row2['waarde']."' readonly='readonly'></li>";}else {break;}}echo "</ul><span class='add' alt='".$i."'>+</span></td>";}else {echo "<td><ul class='sortable'></ul><span class='add' alt='".$i."'>+</span></td>";}$i++;
					echo "</tr>";
				}
				$wijzig++;
				
				// Dempers (compressie)		
				if(empty($_GET['wijzig']) || $_GET['wijzig'] <> $wijzig) {
					echo "<tr class='klein'>";
						echo "<td class='left_align'><a href='./?setup=".$_GET['setup']."&wijzig=".$wijzig."'>Dempers (compressie)</a></td>";
						if($row2['veld'] == $i) {$waarde = $row2['waarde'];$row2 = mysql_fetch_array($result);echo "<td";if($row2['veld'] == $i) {echo " class='tooltip_disappear' title='".$row2['waarde'];while($row2 = mysql_fetch_array($result)) {if($row2['veld'] == $i){echo "<br>".$row2['waarde'];}else {break;}}echo "'";}echo ">".$waarde."</td>";}else {echo "<td>-</td>";}$i++;
						if($row2['veld'] == $i) {$waarde = $row2['waarde'];$row2 = mysql_fetch_array($result);echo "<td";if($row2['veld'] == $i) {echo " class='tooltip_disappear' title='".$row2['waarde'];while($row2 = mysql_fetch_array($result)) {if($row2['veld'] == $i){echo "<br>".$row2['waarde'];}else {break;}}echo "'";}echo ">".$waarde."</td>";}else {echo "<td>-</td>";}$i++;
					echo "</tr>";
				}else {
					//Wijzigen
					echo "<tr class='klein'>";
						echo "<td class='left_align'><a href='./?setup=".$_GET['setup']."'>Dempers (compressie)</a></td>";
						if($row2['veld'] == $i) {echo "<td style='overflow: visible;'><ul class='sortable'><li>&bull; <input class='small_input' type='text' name='v".$i."[]' value='".$row2['waarde']."' readonly='readonly'></li>";while($row2 = mysql_fetch_array($result)) {if($row2['veld'] == $i) {echo "<li>&bull; <input class='small_input' type='text' name='v".$i."[]' value='".$row2['waarde']."' readonly='readonly'></li>";}else {break;}}echo "</ul><span class='add' alt='".$i."'>+</span></td>";}else {echo "<td><ul class='sortable'></ul><span class='add' alt='".$i."'>+</span></td>";}$i++;
						if($row2['veld'] == $i) {echo "<td style='overflow: visible;'><ul class='sortable'><li>&bull; <input class='small_input' type='text' name='v".$i."[]' value='".$row2['waarde']."' readonly='readonly'></li>";while($row2 = mysql_fetch_array($result)) {if($row2['veld'] == $i) {echo "<li>&bull; <input class='small_input' type='text' name='v".$i."[]' value='".$row2['waarde']."' readonly='readonly'></li>";}else {break;}}echo "</ul><span class='add' alt='".$i."'>+</span></td>";}else {echo "<td><ul class='sortable'></ul><span class='add' alt='".$i."'>+</span></td>";}$i++;
					echo "</tr>";
				}
				$wijzig++;
				
				// Stabilisatoren
				if(empty($_GET['wijzig']) || $_GET['wijzig'] <> $wijzig) {
					echo "<tr class='klein'>";
						echo "<td class='left_align'><a href='./?setup=".$_GET['setup']."&wijzig=".$wijzig."'>Stabilisatoren</a></td>";
						if($row2['veld'] == $i) {$waarde = $row2['waarde'];$row2 = mysql_fetch_array($result);echo "<td";if($row2['veld'] == $i) {echo " class='tooltip_disappear' title='".$row2['waarde'];while($row2 = mysql_fetch_array($result)) {if($row2['veld'] == $i){echo "<br>".$row2['waarde'];}else {break;}}echo "'";}echo ">".$waarde."</td>";}else {echo "<td>-</td>";}$i++;
						if($row2['veld'] == $i) {$waarde = $row2['waarde'];$row2 = mysql_fetch_array($result);echo "<td";if($row2['veld'] == $i) {echo " class='tooltip_disappear' title='".$row2['waarde'];while($row2 = mysql_fetch_array($result)) {if($row2['veld'] == $i){echo "<br>".$row2['waarde'];}else {break;}}echo "'";}echo ">".$waarde."</td>";}else {echo "<td>-</td>";}$i++;
					echo "</tr>";
				}else {
					//Wijzigen
					echo "<tr class='klein'>";
						echo "<td class='left_align'><a href='./?setup=".$_GET['setup']."'>Stabilisatoren</a></td>";
						if($row2['veld'] == $i) {echo "<td style='overflow: visible;'><ul class='sortable'><li>&bull; <input class='small_input' type='text' name='v".$i."[]' value='".$row2['waarde']."' readonly='readonly'></li>";while($row2 = mysql_fetch_array($result)) {if($row2['veld'] == $i) {echo "<li>&bull; <input class='small_input' type='text' name='v".$i."[]' value='".$row2['waarde']."' readonly='readonly'></li>";}else {break;}}echo "</ul><span class='add' alt='".$i."'>+</span></td>";}else {echo "<td><ul class='sortable'></ul><span class='add' alt='".$i."'>+</span></td>";}$i++;
						if($row2['veld'] == $i) {echo "<td style='overflow: visible;'><ul class='sortable'><li>&bull; <input class='small_input' type='text' name='v".$i."[]' value='".$row2['waarde']."' readonly='readonly'></li>";while($row2 = mysql_fetch_array($result)) {if($row2['veld'] == $i) {echo "<li>&bull; <input class='small_input' type='text' name='v".$i."[]' value='".$row2['waarde']."' readonly='readonly'></li>";}else {break;}}echo "</ul><span class='add' alt='".$i."'>+</span></td>";}else {echo "<td><ul class='sortable'></ul><span class='add' alt='".$i."'>+</span></td>";}$i++;
					echo "</tr>";
				}
				$wijzig++;
				
				// Camber
				if(empty($_GET['wijzig']) || $_GET['wijzig'] <> $wijzig) {
					echo "<tr class='klein'>";
						echo "<td class='left_align'><a href='./?setup=".$_GET['setup']."&wijzig=".$wijzig."'>Camber (-)</a></td>";
						if($row2['veld'] == $i) {$waarde = (empty($row2['waarde']) ? "0" : number_format(($row2['waarde']/10), 1, ',', '.'));$row2 = mysql_fetch_array($result);echo "<td";if($row2['veld'] == $i) {echo " class='tooltip_disappear' title='".(empty($row2['waarde']) ? "0" : number_format(($row2['waarde']/10), 1, ',', '.'));while($row2 = mysql_fetch_array($result)) {if($row2['veld'] == $i){echo "<br>".(empty($row2['waarde']) ? "0" : number_format(($row2['waarde']/10), 1, ',', '.'));}else {break;}}echo "'";}echo ">".$waarde."</td>";}else {echo "<td>-</td>";}$i++;
						if($row2['veld'] == $i) {$waarde = (empty($row2['waarde']) ? "0" : number_format(($row2['waarde']/10), 1, ',', '.'));$row2 = mysql_fetch_array($result);echo "<td";if($row2['veld'] == $i) {echo " class='tooltip_disappear' title='".(empty($row2['waarde']) ? "0" : number_format(($row2['waarde']/10), 1, ',', '.'));while($row2 = mysql_fetch_array($result)) {if($row2['veld'] == $i){echo "<br>".(empty($row2['waarde']) ? "0" : number_format(($row2['waarde']/10), 1, ',', '.'));}else {break;}}echo "'";}echo ">".$waarde."</td>";}else {echo "<td>-</td>";}$i++;
					echo "</tr>";
				}else {
					//Wijzigen
					echo "<tr class='klein'>";
						echo "<td class='left_align'><a href='./?setup=".$_GET['setup']."'>Camber (-)</a></td>";
						if($row2['veld'] == $i) {echo "<td style='overflow: visible;'><ul class='sortable'><li>&bull; <input class='small_input' type='text' name='v".$i."[]' value='".($row2['waarde']/10)."' readonly='readonly'></li>";while($row2 = mysql_fetch_array($result)) {if($row2['veld'] == $i) {echo "<li>&bull; <input class='small_input' type='text' name='v".$i."[]' value='".($row2['waarde']/10)."' readonly='readonly'></li>";}else {break;}}echo "</ul><span class='add' alt='".$i."'>+</span></td>";}else {echo "<td><ul class='sortable'></ul><span class='add' alt='".$i."'>+</span></td>";}$i++;
						if($row2['veld'] == $i) {echo "<td style='overflow: visible;'><ul class='sortable'><li>&bull; <input class='small_input' type='text' name='v".$i."[]' value='".($row2['waarde']/10)."' readonly='readonly'></li>";while($row2 = mysql_fetch_array($result)) {if($row2['veld'] == $i) {echo "<li>&bull; <input class='small_input' type='text' name='v".$i."[]' value='".($row2['waarde']/10)."' readonly='readonly'></li>";}else {break;}}echo "</ul><span class='add' alt='".$i."'>+</span></td>";}else {echo "<td><ul class='sortable'></ul><span class='add' alt='".$i."'>+</span></td>";}$i++;
					echo "</tr>";
				}
				$wijzig++;
				
				// Toespoor/uitspoor
				if(empty($_GET['wijzig']) || $_GET['wijzig'] <> $wijzig) {
					echo "<tr class='klein'>";
						echo "<td class='left_align'><a href='./?setup=".$_GET['setup']."&wijzig=".$wijzig."'>Toespoor/uitspoor</a></td>";
						if($row2['veld'] == $i) {$waarde = (empty($row2['waarde']) ? "0" : number_format(($row2['waarde']/100), 2, ',', '.'));$row2 = mysql_fetch_array($result);echo "<td";if($row2['veld'] == $i) {echo " class='tooltip_disappear' title='".(empty($row2['waarde']) ? "0" : number_format(($row2['waarde']/100), 2, ',', '.'));while($row2 = mysql_fetch_array($result)) {if($row2['veld'] == $i){echo "<br>".(empty($row2['waarde']) ? "0" : number_format(($row2['waarde']/100), 2, ',', '.'));}else {break;}}echo "'";}echo ">".$waarde."</td>";}else {echo "<td>-</td>";}$i++;
						if($row2['veld'] == $i) {$waarde = (empty($row2['waarde']) ? "0" : number_format(($row2['waarde']/100), 2, ',', '.'));$row2 = mysql_fetch_array($result);echo "<td";if($row2['veld'] == $i) {echo " class='tooltip_disappear' title='".(empty($row2['waarde']) ? "0" : number_format(($row2['waarde']/100), 2, ',', '.'));while($row2 = mysql_fetch_array($result)) {if($row2['veld'] == $i){echo "<br>".(empty($row2['waarde']) ? "0" : number_format(($row2['waarde']/100), 2, ',', '.'));}else {break;}}echo "'";}echo ">".$waarde."</td>";}else {echo "<td>-</td>";}$i++;
					echo "</tr>";
				}else {
					//Wijzigen
					echo "<tr class='klein'>";
						echo "<td class='left_align'><a href='./?setup=".$_GET['setup']."'>Toespoor/uitspoor)</a></td>";
						if($row2['veld'] == $i) {echo "<td style='overflow: visible;'><ul class='sortable'><li>&bull; <input class='small_input' type='text' name='v".$i."[]' value='".($row2['waarde']/100)."' readonly='readonly'></li>";while($row2 = mysql_fetch_array($result)) {if($row2['veld'] == $i) {echo "<li>&bull; <input class='small_input' type='text' name='v".$i."[]' value='".($row2['waarde']/100)."' readonly='readonly'></li>";}else {break;}}echo "</ul><span class='add' alt='".$i."'>+</span></td>";}else {echo "<td><ul class='sortable'></ul><span class='add' alt='".$i."'>+</span></td>";}$i++;
						if($row2['veld'] == $i) {echo "<td style='overflow: visible;'><ul class='sortable'><li>&bull; <input class='small_input' type='text' name='v".$i."[]' value='".($row2['waarde']/100)."' readonly='readonly'></li>";while($row2 = mysql_fetch_array($result)) {if($row2['veld'] == $i) {echo "<li>&bull; <input class='small_input' type='text' name='v".$i."[]' value='".($row2['waarde']/100)."' readonly='readonly'></li>";}else {break;}}echo "</ul><span class='add' alt='".$i."'>+</span></td>";}else {echo "<td><ul class='sortable'></ul><span class='add' alt='".$i."'>+</span></td>";}$i++;
					echo "</tr>";
				}
				$wijzig++;
				
				// LSD
				echo "<tr class='klein'>";
					echo "<td class='sub_titel no_hover left_align'>LSD</td>";
					echo "<td class='sub_titel no_hover'>Voor</td>";
					echo "<td class='sub_titel no_hover'>Achter</td>";
				echo "</tr>";
								
				// Startkoppel
				if(empty($_GET['wijzig']) || $_GET['wijzig'] <> $wijzig) {
					echo "<tr class='klein'>";
						echo "<td class='left_align'><a href='./?setup=".$_GET['setup']."&wijzig=".$wijzig."'>Startkoppel</a></td>";
						if($row2['veld'] == $i) {$waarde = $row2['waarde'];$row2 = mysql_fetch_array($result);echo "<td";if($row2['veld'] == $i) {echo " class='tooltip_disappear' title='".$row2['waarde'];while($row2 = mysql_fetch_array($result)) {if($row2['veld'] == $i){echo "<br>".$row2['waarde'];}else {break;}}echo "'";}echo ">".$waarde."</td>";}else {echo "<td>-</td>";}$i++;
						if($row2['veld'] == $i) {$waarde = $row2['waarde'];$row2 = mysql_fetch_array($result);echo "<td";if($row2['veld'] == $i) {echo " class='tooltip_disappear' title='".$row2['waarde'];while($row2 = mysql_fetch_array($result)) {if($row2['veld'] == $i){echo "<br>".$row2['waarde'];}else {break;}}echo "'";}echo ">".$waarde."</td>";}else {echo "<td>-</td>";}$i++;
					echo "</tr>";
				}else {
					//Wijzigen
					echo "<tr class='klein'>";
						echo "<td class='left_align'><a href='./?setup=".$_GET['setup']."'>Startkoppel</a></td>";
						if($row2['veld'] == $i) {echo "<td style='overflow: visible;'><ul class='sortable'><li>&bull; <input class='small_input' type='text' name='v".$i."[]' value='".$row2['waarde']."' readonly='readonly'></li>";while($row2 = mysql_fetch_array($result)) {if($row2['veld'] == $i) {echo "<li>&bull; <input class='small_input' type='text' name='v".$i."[]' value='".$row2['waarde']."' readonly='readonly'></li>";}else {break;}}echo "</ul><span class='add' alt='".$i."'>+</span></td>";}else {echo "<td><ul class='sortable'></ul><span class='add' alt='".$i."'>+</span></td>";}$i++;
						if($row2['veld'] == $i) {echo "<td style='overflow: visible;'><ul class='sortable'><li>&bull; <input class='small_input' type='text' name='v".$i."[]' value='".$row2['waarde']."' readonly='readonly'></li>";while($row2 = mysql_fetch_array($result)) {if($row2['veld'] == $i) {echo "<li>&bull; <input class='small_input' type='text' name='v".$i."[]' value='".$row2['waarde']."' readonly='readonly'></li>";}else {break;}}echo "</ul><span class='add' alt='".$i."'>+</span></td>";}else {echo "<td><ul class='sortable'></ul><span class='add' alt='".$i."'>+</span></td>";}$i++;
					echo "</tr>";
				}
				$wijzig++;
				
				// Acceleratiegevoeligheid
				if(empty($_GET['wijzig']) || $_GET['wijzig'] <> $wijzig) {
					echo "<tr class='klein'>";
						echo "<td class='left_align'><a href='./?setup=".$_GET['setup']."&wijzig=".$wijzig."'>Acceleratiegevoeligheid</a></td>";
						if($row2['veld'] == $i) {$waarde = $row2['waarde'];$row2 = mysql_fetch_array($result);echo "<td";if($row2['veld'] == $i) {echo " class='tooltip_disappear' title='".$row2['waarde'];while($row2 = mysql_fetch_array($result)) {if($row2['veld'] == $i){echo "<br>".$row2['waarde'];}else {break;}}echo "'";}echo ">".$waarde."</td>";}else {echo "<td>-</td>";}$i++;
						if($row2['veld'] == $i) {$waarde = $row2['waarde'];$row2 = mysql_fetch_array($result);echo "<td";if($row2['veld'] == $i) {echo " class='tooltip_disappear' title='".$row2['waarde'];while($row2 = mysql_fetch_array($result)) {if($row2['veld'] == $i){echo "<br>".$row2['waarde'];}else {break;}}echo "'";}echo ">".$waarde."</td>";}else {echo "<td>-</td>";}$i++;
					echo "</tr>";
				}else {
					//Wijzigen
					echo "<tr class='klein'>";
						echo "<td class='left_align'><a href='./?setup=".$_GET['setup']."'>Acceleratiegevoeligheid</a></td>";
						if($row2['veld'] == $i) {echo "<td style='overflow: visible;'><ul class='sortable'><li>&bull; <input class='small_input' type='text' name='v".$i."[]' value='".$row2['waarde']."' readonly='readonly'></li>";while($row2 = mysql_fetch_array($result)) {if($row2['veld'] == $i) {echo "<li>&bull; <input class='small_input' type='text' name='v".$i."[]' value='".$row2['waarde']."' readonly='readonly'></li>";}else {break;}}echo "</ul><span class='add' alt='".$i."'>+</span></td>";}else {echo "<td><ul class='sortable'></ul><span class='add' alt='".$i."'>+</span></td>";}$i++;
						if($row2['veld'] == $i) {echo "<td style='overflow: visible;'><ul class='sortable'><li>&bull; <input class='small_input' type='text' name='v".$i."[]' value='".$row2['waarde']."' readonly='readonly'></li>";while($row2 = mysql_fetch_array($result)) {if($row2['veld'] == $i) {echo "<li>&bull; <input class='small_input' type='text' name='v".$i."[]' value='".$row2['waarde']."' readonly='readonly'></li>";}else {break;}}echo "</ul><span class='add' alt='".$i."'>+</span></td>";}else {echo "<td><ul class='sortable'></ul><span class='add' alt='".$i."'>+</span></td>";}$i++;
					echo "</tr>";
				}
				$wijzig++;
				
				// Remgevoeligheid
				if(empty($_GET['wijzig']) || $_GET['wijzig'] <> $wijzig) {
					echo "<tr class='klein'>";
						echo "<td class='left_align'><a href='./?setup=".$_GET['setup']."&wijzig=".$wijzig."'>Remgevoeligheid</a></td>";
						if($row2['veld'] == $i) {$waarde = $row2['waarde'];$row2 = mysql_fetch_array($result);echo "<td";if($row2['veld'] == $i) {echo " class='tooltip_disappear' title='".$row2['waarde'];while($row2 = mysql_fetch_array($result)) {if($row2['veld'] == $i){echo "<br>".$row2['waarde'];}else {break;}}echo "'";}echo ">".$waarde."</td>";}else {echo "<td>-</td>";}$i++;
						if($row2['veld'] == $i) {$waarde = $row2['waarde'];$row2 = mysql_fetch_array($result);echo "<td";if($row2['veld'] == $i) {echo " class='tooltip_disappear' title='".$row2['waarde'];while($row2 = mysql_fetch_array($result)) {if($row2['veld'] == $i){echo "<br>".$row2['waarde'];}else {break;}}echo "'";}echo ">".$waarde."</td>";}else {echo "<td>-</td>";}$i++;
					echo "</tr>";
				}else {
					//Wijzigen
					echo "<tr class='klein'>";
						echo "<td class='left_align'><a href='./?setup=".$_GET['setup']."'>Remgevoeligheid</a></td>";
						if($row2['veld'] == $i) {echo "<td style='overflow: visible;'><ul class='sortable'><li>&bull; <input class='small_input' type='text' name='v".$i."[]' value='".$row2['waarde']."' readonly='readonly'></li>";while($row2 = mysql_fetch_array($result)) {if($row2['veld'] == $i) {echo "<li>&bull; <input class='small_input' type='text' name='v".$i."[]' value='".$row2['waarde']."' readonly='readonly'></li>";}else {break;}}echo "</ul><span class='add' alt='".$i."'>+</span></td>";}else {echo "<td><ul class='sortable'></ul><span class='add' alt='".$i."'>+</span></td>";}$i++;
						if($row2['veld'] == $i) {echo "<td style='overflow: visible;'><ul class='sortable'><li>&bull; <input class='small_input' type='text' name='v".$i."[]' value='".$row2['waarde']."' readonly='readonly'></li>";while($row2 = mysql_fetch_array($result)) {if($row2['veld'] == $i) {echo "<li>&bull; <input class='small_input' type='text' name='v".$i."[]' value='".$row2['waarde']."' readonly='readonly'></li>";}else {break;}}echo "</ul><span class='add' alt='".$i."'>+</span></td>";}else {echo "<td><ul class='sortable'></ul><span class='add' alt='".$i."'>+</span></td>";}$i++;
					echo "</tr>";
				}
				$wijzig++;
				
				// downforce
				echo "<tr class='klein'>";
					echo "<td class='sub_titel no_hover left_align'>Downforce</td>";
					echo "<td class='sub_titel no_hover'>Voor</td>";
					echo "<td class='sub_titel no_hover'>Achter</td>";
				echo "</tr>";
				
				// Neerwaartse kracht
				if(empty($_GET['wijzig']) || $_GET['wijzig'] <> $wijzig) {
					echo "<tr class='klein'>";
						echo "<td class='left_align'><a href='./?setup=".$_GET['setup']."&wijzig=".$wijzig."'>Neerwaartse kracht</a></td>";
						if($row2['veld'] == $i) {$waarde = $row2['waarde'];$row2 = mysql_fetch_array($result);echo "<td";if($row2['veld'] == $i) {echo " class='tooltip_disappear' title='".$row2['waarde'];while($row2 = mysql_fetch_array($result)) {if($row2['veld'] == $i){echo "<br>".$row2['waarde'];}else {break;}}echo "'";}echo ">".$waarde."</td>";}else {echo "<td>-</td>";}$i++;
						if($row2['veld'] == $i) {$waarde = $row2['waarde'];$row2 = mysql_fetch_array($result);echo "<td";if($row2['veld'] == $i) {echo " class='tooltip_disappear' title='".$row2['waarde'];while($row2 = mysql_fetch_array($result)) {if($row2['veld'] == $i){echo "<br>".$row2['waarde'];}else {break;}}echo "'";}echo ">".$waarde."</td>";}else {echo "<td>-</td>";}$i++;
					echo "</tr>";
				}else {
					//Wijzigen
					echo "<tr class='klein'>";
						echo "<td class='left_align'><a href='./?setup=".$_GET['setup']."'>Neerwaartse kracht</a></td>";
						if($row2['veld'] == $i) {echo "<td style='overflow: visible;'><ul class='sortable'><li>&bull; <input class='small_input' type='text' name='v".$i."[]' value='".$row2['waarde']."' readonly='readonly'></li>";while($row2 = mysql_fetch_array($result)) {if($row2['veld'] == $i) {echo "<li>&bull; <input class='small_input' type='text' name='v".$i."[]' value='".$row2['waarde']."' readonly='readonly'></li>";}else {break;}}echo "</ul><span class='add' alt='".$i."'>+</span></td>";}else {echo "<td><ul class='sortable'></ul><span class='add' alt='".$i."'>+</span></td>";}$i++;
						if($row2['veld'] == $i) {echo "<td style='overflow: visible;'><ul class='sortable'><li>&bull; <input class='small_input' type='text' name='v".$i."[]' value='".$row2['waarde']."' readonly='readonly'></li>";while($row2 = mysql_fetch_array($result)) {if($row2['veld'] == $i) {echo "<li>&bull; <input class='small_input' type='text' name='v".$i."[]' value='".$row2['waarde']."' readonly='readonly'></li>";}else {break;}}echo "</ul><span class='add' alt='".$i."'>+</span></td>";}else {echo "<td><ul class='sortable'></ul><span class='add' alt='".$i."'>+</span></td>";}$i++;
					echo "</tr>";
				}
				$wijzig++;
				
				// Rembalansknop
				echo "<tr class='klein'>";
					echo "<td class='sub_titel no_hover left_align'>Rembalansknop</td>";
					echo "<td class='sub_titel no_hover'>Voor</td>";
					echo "<td class='sub_titel no_hover'>Achter</td>";
				echo "</tr>";
				
				// Rembalans
				if(empty($_GET['wijzig']) || $_GET['wijzig'] <> $wijzig) {
					echo "<tr class='klein'>";
						echo "<td class='left_align'><a href='./?setup=".$_GET['setup']."&wijzig=".$wijzig."'>Rembalans</a></td>";
						if($row2['veld'] == $i) {$waarde = $row2['waarde'];$row2 = mysql_fetch_array($result);echo "<td";if($row2['veld'] == $i) {echo " class='tooltip_disappear' title='".$row2['waarde'];while($row2 = mysql_fetch_array($result)) {if($row2['veld'] == $i){echo "<br>".$row2['waarde'];}else {break;}}echo "'";}echo ">".$waarde."</td>";}else {echo "<td>-</td>";}$i++;
						if($row2['veld'] == $i) {$waarde = $row2['waarde'];$row2 = mysql_fetch_array($result);echo "<td";if($row2['veld'] == $i) {echo " class='tooltip_disappear' title='".$row2['waarde'];while($row2 = mysql_fetch_array($result)) {if($row2['veld'] == $i){echo "<br>".$row2['waarde'];}else {break;}}echo "'";}echo ">".$waarde."</td>";}else {echo "<td>-</td>";}$i++;
					echo "</tr>";
				}else {
					//Wijzigen
					echo "<tr class='klein'>";
						echo "<td class='left_align'><a href='./?setup=".$_GET['setup']."'>Rembalans</a></td>";
						if($row2['veld'] == $i) {echo "<td style='overflow: visible;'><ul class='sortable'><li>&bull; <input class='small_input' type='text' name='v".$i."[]' value='".$row2['waarde']."' readonly='readonly'></li>";while($row2 = mysql_fetch_array($result)) {if($row2['veld'] == $i) {echo "<li>&bull; <input class='small_input' type='text' name='v".$i."[]' value='".$row2['waarde']."' readonly='readonly'></li>";}else {break;}}echo "</ul><span class='add' alt='".$i."'>+</span></td>";}else {echo "<td><ul class='sortable'></ul><span class='add' alt='".$i."'>+</span></td>";}$i++;
						if($row2['veld'] == $i) {echo "<td style='overflow: visible;'><ul class='sortable'><li>&bull; <input class='small_input' type='text' name='v".$i."[]' value='".$row2['waarde']."' readonly='readonly'></li>";while($row2 = mysql_fetch_array($result)) {if($row2['veld'] == $i) {echo "<li>&bull; <input class='small_input' type='text' name='v".$i."[]' value='".$row2['waarde']."' readonly='readonly'></li>";}else {break;}}echo "</ul><span class='add' alt='".$i."'>+</span></td>";}else {echo "<td><ul class='sortable'></ul><span class='add' alt='".$i."'>+</span></td>";}$i++;
					echo "</tr>";
				}
				$wijzig++;
			echo "</table>";
		echo "</div>";
		
		echo "<div class='left' style='float: left; width: 350px;'>";
			echo "<table class='content small_border right_align padding'>";
				// gewichtsaanpassingen
				echo "<tr class='klein'>";
					echo "<td style='width: 190px;' class='sub_titel no_hover left_align'>Gewichtsaanpassingen</td>";
					echo "<td style='width: 64px;' class='sub_titel no_hover'>&nbsp;</td>";
				echo "</tr>";
				
				// Ballast (kg)
				if(empty($_GET['wijzig']) || $_GET['wijzig'] <> $wijzig) {
					echo "<tr class='klein'>";
						echo "<td class='left_align'><a href='./?setup=".$_GET['setup']."&wijzig=".$wijzig."'>Ballast (kg)</a></td>";
						echo "<td>".$row['ballast']."</td>";
					echo "</tr>";
				}else {
					echo "<tr class='klein'>";
						echo "<td class='left_align'><a href='./?setup=".$_GET['setup']."'>Ballast (kg)</a></td>";
						echo "<td style='overflow: visible;'><input class='small_input' type='text' name='ballast' value='".$row['ballast']."'>";
					echo "</tr>";
				}
				$wijzig++;
				
				//Ballastpositie
				if(empty($_GET['wijzig']) || $_GET['wijzig'] <> $wijzig) {
					echo "<tr class='klein'>";
						echo "<td class='left_align'><a href='./?setup=".$_GET['setup']."&wijzig=".$wijzig."'>Ballastpositie</a></td>";
						if($row2['veld'] == $i) {$waarde = $row2['waarde'];$row2 = mysql_fetch_array($result);echo "<td";if($row2['veld'] == $i) {echo " class='tooltip_disappear' title='".$row2['waarde'];while($row2 = mysql_fetch_array($result)) {if($row2['veld'] == $i){echo "<br>".$row2['waarde'];}else {break;}}echo "'";}echo ">".$waarde."</td>";}else {echo "<td>-</td>";}$i++;
					echo "</tr>";
				}else {
					echo "<tr class='klein'>";
						echo "<td class='left_align'><a href='./?setup=".$_GET['setup']."'>Ballastpositie</a></td>";
						if($row2['veld'] == $i) {echo "<td style='overflow: visible;'><ul class='sortable'><li>&bull; <input class='small_input' type='text' name='v".$i."[]' value='".$row2['waarde']."' readonly='readonly'></li>";while($row2 = mysql_fetch_array($result)) {if($row2['veld'] == $i) {echo "<li>&bull; <input class='small_input' type='text' name='v".$i."[]' value='".$row2['waarde']."' readonly='readonly'></li>";}else {break;}}echo "</ul><span class='add' alt='".$i."'>+</span></td>";}else {echo "<td><ul class='sortable'></ul><span class='add' alt='".$i."'>+</span></td>";}$i++;
					echo "</tr>";
				}
				$wijzig++;
				
				// vermogensbegrenzer
				echo "<tr class='klein'>";
					echo "<td class='sub_titel no_hover left_align'>Vermogensbegrenzer</td>";
					echo "<td class='sub_titel no_hover'>&nbsp;</td>";
				echo "</tr>";
				
				// vermogensniveau
				if(empty($_GET['wijzig']) || $_GET['wijzig'] <> $wijzig) {
					echo "<tr class='klein'>";
						echo "<td class='left_align'><a href='./?setup=".$_GET['setup']."&wijzig=".$wijzig."'>Vermogensniveau</a></td>";
						echo "<td>".(empty($row['vermogensniveau']) ? "100" : number_format(($row['vermogensniveau']/10), 1, ',', '.'))."%</td>";
					echo "</tr>";
				}else {
					echo "<tr class='klein'>";
						echo "<td class='left_align'><a href='./?setup=".$_GET['setup']."'>Vermogensniveau</a></td>";
						echo "<td style='overflow: visible;'><input class='small_input' type='text' name='vermogensniveau' value='".($row['vermogensniveau']/10)."'>";
					echo "</tr>";
				}
				$wijzig++;
				
				// overbrenging
				echo "<tr class='klein'>";
					echo "<td class='sub_titel no_hover left_align'>Overbrenging</td>";
					echo "<td class='sub_titel no_hover'>&nbsp;</td>";
				echo "</tr>";
				
				// 1e Versn.
				if(empty($_GET['wijzig']) || $_GET['wijzig'] <> $wijzig) {
					echo "<tr class='klein'>";
						echo "<td class='left_align'><a href='./?setup=".$_GET['setup']."&wijzig=".$wijzig."'>1e Versn.</a></td>";
						if($row2['veld'] == $i) {$waarde = number_format($row2['waarde'], 0, ',', '.');$row2 = mysql_fetch_array($result);echo "<td";if($row2['veld'] == $i) {echo " class='tooltip_disappear' title='".number_format($row2['waarde'], 0, ',', '.');while($row2 = mysql_fetch_array($result)) {if($row2['veld'] == $i){echo "<br>".number_format($row2['waarde'], 0, ',', '.');}else {break;}}echo "'";}echo ">".$waarde."</td>";}else {echo "<td>-</td>";}$i++;
					echo "</tr>";
				}else {
					echo "<tr class='klein'>";
						echo "<td class='left_align'><a href='./?setup=".$_GET['setup']."'>1e Versn.</a></td>";
						if($row2['veld'] == $i) {echo "<td style='overflow: visible;'><ul class='sortable'><li>&bull; <input class='small_input' type='text' name='v".$i."[]' value='".$row2['waarde']."' readonly='readonly'></li>";while($row2 = mysql_fetch_array($result)) {if($row2['veld'] == $i) {echo "<li>&bull; <input class='small_input' type='text' name='v".$i."[]' value='".$row2['waarde']."' readonly='readonly'></li>";}else {break;}}echo "</ul><span class='add' alt='".$i."'>+</span></td>";}else {echo "<td><ul class='sortable'></ul><span class='add' alt='".$i."'>+</span></td>";}$i++;
					echo "</tr>";
				}
				$wijzig++;
				
				// 2e Versn.
				if(empty($_GET['wijzig']) || $_GET['wijzig'] <> $wijzig) {
					echo "<tr class='klein'>";
						echo "<td class='left_align'><a href='./?setup=".$_GET['setup']."&wijzig=".$wijzig."'>2e Versn.</a></td>";
						if($row2['veld'] == $i) {$waarde = number_format($row2['waarde'], 0, ',', '.');$row2 = mysql_fetch_array($result);echo "<td";if($row2['veld'] == $i) {echo " class='tooltip_disappear' title='".number_format($row2['waarde'], 0, ',', '.');while($row2 = mysql_fetch_array($result)) {if($row2['veld'] == $i){echo "<br>".number_format($row2['waarde'], 0, ',', '.');}else {break;}}echo "'";}echo ">".$waarde."</td>";}else {echo "<td>-</td>";}$i++;
					echo "</tr>";
				}else {
					echo "<tr class='klein'>";
						echo "<td class='left_align'><a href='./?setup=".$_GET['setup']."'>2e Versn.</a></td>";
						if($row2['veld'] == $i) {echo "<td style='overflow: visible;'><ul class='sortable'><li>&bull; <input class='small_input' type='text' name='v".$i."[]' value='".$row2['waarde']."' readonly='readonly'></li>";while($row2 = mysql_fetch_array($result)) {if($row2['veld'] == $i) {echo "<li>&bull; <input class='small_input' type='text' name='v".$i."[]' value='".$row2['waarde']."' readonly='readonly'></li>";}else {break;}}echo "</ul><span class='add' alt='".$i."'>+</span></td>";}else {echo "<td><ul class='sortable'></ul><span class='add' alt='".$i."'>+</span></td>";}$i++;
					echo "</tr>";
				}
				$wijzig++;
				
				// 3e Versn.
				if(empty($_GET['wijzig']) || $_GET['wijzig'] <> $wijzig) {
					echo "<tr class='klein'>";
						echo "<td class='left_align'><a href='./?setup=".$_GET['setup']."&wijzig=".$wijzig."'>3e Versn.</a></td>";
						if($row2['veld'] == $i) {$waarde = number_format($row2['waarde'], 0, ',', '.');$row2 = mysql_fetch_array($result);echo "<td";if($row2['veld'] == $i) {echo " class='tooltip_disappear' title='".number_format($row2['waarde'], 0, ',', '.');while($row2 = mysql_fetch_array($result)) {if($row2['veld'] == $i){echo "<br>".number_format($row2['waarde'], 0, ',', '.');}else {break;}}echo "'";}echo ">".$waarde."</td>";}else {echo "<td>-</td>";}$i++;
					echo "</tr>";
				}else {
					echo "<tr class='klein'>";
						echo "<td class='left_align'><a href='./?setup=".$_GET['setup']."'>3e Versn.</a></td>";
						if($row2['veld'] == $i) {echo "<td style='overflow: visible;'><ul class='sortable'><li>&bull; <input class='small_input' type='text' name='v".$i."[]' value='".$row2['waarde']."' readonly='readonly'></li>";while($row2 = mysql_fetch_array($result)) {if($row2['veld'] == $i) {echo "<li>&bull; <input class='small_input' type='text' name='v".$i."[]' value='".$row2['waarde']."' readonly='readonly'></li>";}else {break;}}echo "</ul><span class='add' alt='".$i."'>+</span></td>";}else {echo "<td><ul class='sortable'></ul><span class='add' alt='".$i."'>+</span></td>";}$i++;
					echo "</tr>";
				}
				$wijzig++;
				
				// 4e Versn.
				if(empty($_GET['wijzig']) || $_GET['wijzig'] <> $wijzig) {
					echo "<tr class='klein'>";
						echo "<td class='left_align'><a href='./?setup=".$_GET['setup']."&wijzig=".$wijzig."'>4e Versn.</a></td>";
						if($row2['veld'] == $i) {$waarde = number_format($row2['waarde'], 0, ',', '.');$row2 = mysql_fetch_array($result);echo "<td";if($row2['veld'] == $i) {echo " class='tooltip_disappear' title='".number_format($row2['waarde'], 0, ',', '.');while($row2 = mysql_fetch_array($result)) {if($row2['veld'] == $i){echo "<br>".number_format($row2['waarde'], 0, ',', '.');}else {break;}}echo "'";}echo ">".$waarde."</td>";}else {echo "<td>-</td>";}$i++;
					echo "</tr>";
				}else {
					echo "<tr class='klein'>";
						echo "<td class='left_align'><a href='./?setup=".$_GET['setup']."'>4e Versn.</a></td>";
						if($row2['veld'] == $i) {echo "<td style='overflow: visible;'><ul class='sortable'><li>&bull; <input class='small_input' type='text' name='v".$i."[]' value='".$row2['waarde']."' readonly='readonly'></li>";while($row2 = mysql_fetch_array($result)) {if($row2['veld'] == $i) {echo "<li>&bull; <input class='small_input' type='text' name='v".$i."[]' value='".$row2['waarde']."' readonly='readonly'></li>";}else {break;}}echo "</ul><span class='add' alt='".$i."'>+</span></td>";}else {echo "<td><ul class='sortable'></ul><span class='add' alt='".$i."'>+</span></td>";}$i++;
					echo "</tr>";
				}
				$wijzig++;
				
				// 5e Versn.
				if(empty($_GET['wijzig']) || $_GET['wijzig'] <> $wijzig) {
					echo "<tr class='klein'>";
						echo "<td class='left_align'><a href='./?setup=".$_GET['setup']."&wijzig=".$wijzig."'>5e Versn.</a></td>";
						if($row2['veld'] == $i) {$waarde = number_format($row2['waarde'], 0, ',', '.');$row2 = mysql_fetch_array($result);echo "<td";if($row2['veld'] == $i) {echo " class='tooltip_disappear' title='".number_format($row2['waarde'], 0, ',', '.');while($row2 = mysql_fetch_array($result)) {if($row2['veld'] == $i){echo "<br>".number_format($row2['waarde'], 0, ',', '.');}else {break;}}echo "'";}echo ">".$waarde."</td>";}else {echo "<td>-</td>";}$i++;
					echo "</tr>";
				}else {
					echo "<tr class='klein'>";
						echo "<td class='left_align'><a href='./?setup=".$_GET['setup']."'>5e Versn.</a></td>";
						if($row2['veld'] == $i) {echo "<td style='overflow: visible;'><ul class='sortable'><li>&bull; <input class='small_input' type='text' name='v".$i."[]' value='".$row2['waarde']."' readonly='readonly'></li>";while($row2 = mysql_fetch_array($result)) {if($row2['veld'] == $i) {echo "<li>&bull; <input class='small_input' type='text' name='v".$i."[]' value='".$row2['waarde']."' readonly='readonly'></li>";}else {break;}}echo "</ul><span class='add' alt='".$i."'>+</span></td>";}else {echo "<td><ul class='sortable'></ul><span class='add' alt='".$i."'>+</span></td>";}$i++;
					echo "</tr>";
				}
				$wijzig++;
				
				// 6e Versn.
				if(empty($_GET['wijzig']) || $_GET['wijzig'] <> $wijzig) {
					echo "<tr class='klein'>";
						echo "<td class='left_align'><a href='./?setup=".$_GET['setup']."&wijzig=".$wijzig."'>6e Versn.</a></td>";
						if($row2['veld'] == $i) {$waarde = number_format($row2['waarde'], 0, ',', '.');$row2 = mysql_fetch_array($result);echo "<td";if($row2['veld'] == $i) {echo " class='tooltip_disappear' title='".number_format($row2['waarde'], 0, ',', '.');while($row2 = mysql_fetch_array($result)) {if($row2['veld'] == $i){echo "<br>".number_format($row2['waarde'], 0, ',', '.');}else {break;}}echo "'";}echo ">".$waarde."</td>";}else {echo "<td>-</td>";}$i++;
					echo "</tr>";
				}else {
					echo "<tr class='klein'>";
						echo "<td class='left_align'><a href='./?setup=".$_GET['setup']."'>6e Versn.</a></td>";
						if($row2['veld'] == $i) {echo "<td style='overflow: visible;'><ul class='sortable'><li>&bull; <input class='small_input' type='text' name='v".$i."[]' value='".$row2['waarde']."' readonly='readonly'></li>";while($row2 = mysql_fetch_array($result)) {if($row2['veld'] == $i) {echo "<li>&bull; <input class='small_input' type='text' name='v".$i."[]' value='".$row2['waarde']."' readonly='readonly'></li>";}else {break;}}echo "</ul><span class='add' alt='".$i."'>+</span></td>";}else {echo "<td><ul class='sortable'></ul><span class='add' alt='".$i."'>+</span></td>";}$i++;
					echo "</tr>";
				}
				$wijzig++;
				
				// 7e Versn.
				if(empty($_GET['wijzig']) || $_GET['wijzig'] <> $wijzig) {
					echo "<tr class='klein'>";
						echo "<td class='left_align'><a href='./?setup=".$_GET['setup']."&wijzig=".$wijzig."'>7e Versn.</a></td>";
						if($row2['veld'] == $i) {$waarde = number_format($row2['waarde'], 0, ',', '.');$row2 = mysql_fetch_array($result);echo "<td";if($row2['veld'] == $i) {echo " class='tooltip_disappear' title='".number_format($row2['waarde'], 0, ',', '.');while($row2 = mysql_fetch_array($result)) {if($row2['veld'] == $i){echo "<br>".number_format($row2['waarde'], 0, ',', '.');}else {break;}}echo "'";}echo ">".$waarde."</td>";}else {echo "<td>-</td>";}$i++;
					echo "</tr>";
				}else {
					echo "<tr class='klein'>";
						echo "<td class='left_align'><a href='./?setup=".$_GET['setup']."'>7e Versn.</a></td>";
						if($row2['veld'] == $i) {echo "<td style='overflow: visible;'><ul class='sortable'><li>&bull; <input class='small_input' type='text' name='v".$i."[]' value='".$row2['waarde']."' readonly='readonly'></li>";while($row2 = mysql_fetch_array($result)) {if($row2['veld'] == $i) {echo "<li>&bull; <input class='small_input' type='text' name='v".$i."[]' value='".$row2['waarde']."' readonly='readonly'></li>";}else {break;}}echo "</ul><span class='add' alt='".$i."'>+</span></td>";}else {echo "<td><ul class='sortable'></ul><span class='add' alt='".$i."'>+</span></td>";}$i++;
					echo "</tr>";
				}
				$wijzig++;
				
				// eindoverbrenging
				if(empty($_GET['wijzig']) || $_GET['wijzig'] <> $wijzig) {
					echo "<tr class='klein'>";
						echo "<td class='left_align'><a href='./?setup=".$_GET['setup']."&wijzig=".$wijzig."'>Eindoverbrenging</a></td>";
						if($row2['veld'] == $i) {$waarde = number_format($row2['waarde'], 0, ',', '.');$row2 = mysql_fetch_array($result);echo "<td";if($row2['veld'] == $i) {echo " class='tooltip_disappear' title='".number_format($row2['waarde'], 0, ',', '.');while($row2 = mysql_fetch_array($result)) {if($row2['veld'] == $i){echo "<br>".number_format($row2['waarde'], 0, ',', '.');}else {break;}}echo "'";}echo ">".$waarde."</td>";}else {echo "<td>-</td>";}$i++;
					echo "</tr>";
				}else {
					echo "<tr class='klein'>";
						echo "<td class='left_align'><a href='./?setup=".$_GET['setup']."'>Eindoverbrenging</a></td>";
						if($row2['veld'] == $i) {echo "<td style='overflow: visible;'><ul class='sortable'><li>&bull; <input class='small_input' type='text' name='v".$i."[]' value='".$row2['waarde']."' readonly='readonly'></li>";while($row2 = mysql_fetch_array($result)) {if($row2['veld'] == $i) {echo "<li>&bull; <input class='small_input' type='text' name='v".$i."[]' value='".$row2['waarde']."' readonly='readonly'></li>";}else {break;}}echo "</ul><span class='add' alt='".$i."'>+</span></td>";}else {echo "<td><ul class='sortable'></ul><span class='add' alt='".$i."'>+</span></td>";}$i++;
					echo "</tr>";
				}
				$wijzig++;
				
				// topsnelheid
				if(empty($_GET['wijzig']) || $_GET['wijzig'] <> $wijzig) {
					echo "<tr class='klein'>";
						echo "<td class='left_align'><a href='./?setup=".$_GET['setup']."&wijzig=".$wijzig."'>Topsnelheid</a></td>";
						if($row2['veld'] == $i) {$waarde = number_format($row2['waarde'], 0, ',', '.');$row2 = mysql_fetch_array($result);echo "<td";if($row2['veld'] == $i) {echo " class='tooltip_disappear' title='".number_format($row2['waarde'], 0, ',', '.');while($row2 = mysql_fetch_array($result)) {if($row2['veld'] == $i){echo "<br>".number_format($row2['waarde'], 0, ',', '.');}else {break;}}echo "'";}echo ">".$waarde."</td>";}else {echo "<td>-</td>";}$i++;
					echo "</tr>";
				}else {
					echo "<tr class='klein'>";
						echo "<td class='left_align'><a href='./?setup=".$_GET['setup']."'>Topsnelheid</a></td>";
						if($row2['veld'] == $i) {echo "<td style='overflow: visible;'><ul class='sortable'><li>&bull; <input class='small_input' type='text' name='v".$i."[]' value='".$row2['waarde']."' readonly='readonly'></li>";while($row2 = mysql_fetch_array($result)) {if($row2['veld'] == $i) {echo "<li>&bull; <input class='small_input' type='text' name='v".$i."[]' value='".$row2['waarde']."' readonly='readonly'></li>";}else {break;}}echo "</ul><span class='add' alt='".$i."'>+</span></td>";}else {echo "<td><ul class='sortable'></ul><span class='add' alt='".$i."'>+</span></td>";}$i++;
					echo "</tr>";
				}
				$wijzig++;
			echo "</table>";
		echo "</div>";
		
		if(isset($_GET['wijzig'])) {
			echo "<input type='submit' name='submit' value='Wijzig'>";
			echo "</form>";
		}
		/*echo "</div>";*/
		
		echo "<div class='clear'></div>";
		
		echo "<ul style='text-align: left;'>";
			echo "<li>ECU-tuning</li>";
			echo "<li>Inlaatspruitstuk</li>";
			echo "<li>Raceluchtfilter</li>";
			echo "<li>Turbokut gemiddelde toerentallen</li>";
			echo "<li>Volledig aanpasbare overbrenging</li>";
			echo "<li>Koppeling: dubbele plaat</li>";
			echo "<li>Vliegwiel: semirace</li>";
			echo "<li>Volledig aanpasbaar sperdifferentieel</li>";
			echo "<li>Ophanging Volledig aanpasbare ophanging</li>";
		echo "</ul>";
	}else {
		// TERUG KNOP
		echo "<span class='button' style='margin: 10px 5px 0px;'><a href='./'><span class='icon_font'>B</span> Terug</a></span>";
		
		echo "<p>Setup niet gevonden</p>";
	}
}
echo $mainClass->showPageEnd();
include_once($_SERVER['DOCUMENT_ROOT']."/footer.php");
?>
